home *** CD-ROM | disk | FTP | other *** search
/ CBM Funet Archive / cbm-funet-archive-2003.iso / cbm / c64 / diskutil / directory / Virtual Directory.prg (.txt) < prev   
Encoding:
Commodore BASIC  |  1998-03-11  |  4.2 KB  |  112 lines

  1. 1 rem *********************************
  2. 2 rem *       virtual directory       *
  3. 3 rem *  by r.mason  remjem software  *
  4. 4 rem * runs on c-64,c-128 (40 or 80c)*
  5. 5 rem *      modified for 1581        *
  6. 6 rem *       by tim mitchell         *
  7. 7 rem *          02/19/88             *
  8. 8 rem * (to list on c-64-del line 15) *
  9. 9 rem *********************************
  10. 10 poke53280,0:poke53281,0
  11. 20 print"[147][158]"rg$"          virtual directory             ";rg$:print"":printrg$"   released to public domain 6/20/85":printrg$"         by robert e. mason":printrg$"     output to screen or printer?"
  12. 30 getz$:ifz$=""then30
  13. 40 ifz$="s"thens=1:goto70
  14. 50 ifz$="p"thenp=1:open4,4:goto80
  15. 60 goto30
  16. 70 printrg$"           output to screen":goto90
  17. 80 printrg$"           output to printer"
  18. 90 printrg$"          which drive? (8-9)      "
  19. 91 getk$:ifk$=""then91
  20. 92 k=val(k$):ifk<8ork>9thenk=8
  21. 93 dv=k:df$="":df$=df$+"[158]disk format="
  22. 95 printrg$"     place disk to be read in drive":printrg$"        press any key when ready"
  23. 100 getz$:ifz$=""then100
  24. 101 open15,dv,15:print#15,"i0:":open8,dv,8,"$":gosub900:get#8,a$,b$:ifa$="a"thentr=18
  25. 102 b$=b$+chr$(0)
  26. 103 iftr=18andasc(b$)=0thenbf=664:df$=df$+"1541[146]":print#15,"u0>m0":goto107
  27. 104 ifasc(b$)=128thenbf=1328:df$=df$+"1571[146]":print#15,"u0>m1":goto107
  28. 105 ifa$="d"andasc(b$)=0thentr=40:bf=3160:df$=df$+"1581[146]":goto107
  29. 106 df$=df$+"unknown":tr=0:bf=0
  30. 107 close8:close15:printrg$"           "df$
  31. 109 fori=1to8:readp(i):next:a=1:pb=144:iftr=40thena=3:pb=4
  32. 110 b$="":open15,dv,15:print#15,"i0:":open8,dv,8,"#":dn$="disk name:   ":print#15,"u1:8,0,"tr;0:gosub900:print#15,"b-p:8,"pb
  33. 111 fori=1to23:get#8,b$:b$=chr$(asc(b$+chr$(0))):ifb$=chr$(160)thenb$=" "
  34. 112 dn$=dn$+b$:next:ifpthenprintrg$"         "dn$
  35. 140 t$="[147]"+dn$:t4$="[146][159] start  file name       file  no. load":t3$=" tk bk  on disk         type  bks addr":ifsthenprintt$:print,df$:printt4$:printt3$
  36. 150 t1$=" start  file name       file  no. load":t2$=" tk bk  on disk         type  bks addr"
  37. 151 ifpthenprint#4,dn$:print#4,,df$:print#4,t1$"  "t1$:print#4,t2$"  "t2$:print#4
  38. 160 print#15,"u1:8,0,"tr;a:gosub900:ifsthenprint"directory block";tr;"-";a
  39. 170 ifpthenprint#4:print#4,"directory block";tr;"-";a
  40. 180 print#15,"b-p:8,1":get#8,a$:nb=asc(a$+chr$(0)):fori=1to8:print#15,"b-p:8,"p(i)+1:get#8,bl$,se$:bl=asc(bl$+chr$(0)):bl$=str$(bl):iflen(bl$)<3thenbl$=" "+bl$
  41. 190 d$=bl$:ifbl=0thenf1=1:goto600
  42. 200 se=asc(se$+chr$(0)):se$=str$(se):iflen(se$)<3thense$=" "+se$
  43. 210 d$=d$+se$+" ":forj=1to16:get#8,b$:b$=chr$(asc(b$+chr$(0))):ifb$=chr$(129)thenb$="[193]":goto270
  44. 220 ifb$=chr$(160)thenb$=" ":goto270
  45. 230 ifb$=chr$(192)thenb$=chr$(45):goto270
  46. 240 ifb$<chr$(32)thenb$="?":goto270
  47. 250 ifb$>chr$(127)andb$<chr$(160)thenb$="?":goto270
  48. 260 ifasc(b$)=160thenb$=" ":goto270
  49. 270 d$=d$+b$:next:print#15,"b-p:8,"p(i):get#8,tf$:tf=asc(tf$+chr$(0)):iftf=130thend$=d$+"  prg":goto370
  50. 280 iftf=129thend$=d$+"  seq":goto370
  51. 290 iftf=131thend$=d$+"  usr":goto370
  52. 300 iftf=132thend$=d$+"  rel":goto370
  53. 301 iftf=133thend$=d$+"  cbm":goto370
  54. 310 iftf=0thend$=d$+" *scr":goto370
  55. 320 iftf=1thend$=d$+" *seq":goto370
  56. 330 iftf=2thend$=d$+" *prg":goto370
  57. 340 iftf=3thend$=d$+" *usr":goto370
  58. 350 iftf=4thend$=d$+" *rel":goto370
  59. 351 iftf=5thend$=d$+" *cbm":goto370
  60. 352 iftf=193thend$=d$+" seq<":goto370
  61. 353 iftf=194thend$=d$+" prg<":goto370
  62. 354 iftf=195thend$=d$+" usr<":goto370
  63. 355 iftf=196thend$=d$+" rel<":goto370
  64. 356 iftf=197thend$=d$+" cbm<":goto370
  65. 360 d$=d$+"*"+str$(tf)
  66. 370 print#15,"b-p:8,"p(i)+28:get#8,sf$:sf=asc(sf$+chr$(0)):sf$=str$(sf):iftf>0thenbu=bu+sf
  67. 380 iflen(sf$)<3thensf$="  "+sf$:goto400
  68. 390 iflen(sf$)<4thensf$=" "+sf$
  69. 400 d$=d$+sf$:print#15,"u1:8,0,"bl","se:print#15,"b-p:8,2":gosub900:get#8,la$,ha$:la=asc(la$+chr$(0))+256*asc(ha$+chr$(0)):la$=str$(la):iflen(la$)=2thend$=d$+"    "+la$:goto450
  70. 410 iflen(la$)=3thend$=d$+"   "+la$:goto450
  71. 420 iflen(la$)=4thend$=d$+"  "+la$:goto450
  72. 430 iflen(la$)=5thend$=d$+" "+la$:goto450
  73. 440 d$=d$+la$
  74. 450 l=l+1:ifpthenprint#4,d$"  ";:goto470
  75. 460 printd$
  76. 470 print#15,"u1:8,0,"tr;a:gosub900:d$="":next:ifsandl=16andf2=1thenl=0:goto560
  77. 480 ifsandl=16thenprint"[159]press any key to continue or q to quit";:l=0:goto540
  78. 490 ifsthen520
  79. 500 ifpandint(l/2)=59thenfork=1to8:print#4:next:l=0
  80. 510 ifpandl=0thenprint#4,dn$:print#4:print#4,t1$"  "t1$:print#4,t2$"  "t2$:print#4
  81. 520 ifnb<41thena=nb:goto160
  82. 530 goto600
  83. 540 getz$:ifz$=""then540
  84. 550 ifz$="q"then600
  85. 560 iff2=1then(NULL)40,0,79,24:f2=2:goto580
  86. 570 iff2=2then(NULL)0,0,39,24:f2=1
  87. 580 printt$:print:printt4$:printt3$:iff1then710
  88. 590 goto520
  89. 600 close8:close15:ifpandl<46then690
  90. 610 ifpandint(l/2)>45thenprintchr$(12):goto690
  91. 620 ifsandl<14then710
  92. 630 ifsandl>15thenf1=1:goto480
  93. 640 open15,dv,15,"i0:":close15:print"[159]        another disk? (y/n)           "
  94. 650 getz$:ifz$=""then650
  95. 660 ifz$="y"thenrun
  96. 670 ifz$="n"thenprint"[147]";:end
  97. 680 goto650
  98. 690 print#4:print#4,"blocks used:"bu:print#4,"blocks available:"bf-bu
  99. 691 forx=1toint(56-(l/2)):print#4:next:goto640
  100. 700 print#4,chr$(12):close4:goto640
  101. 710 print:print"blocks examined:"bu:iff1thenprint"blocks available:"bf-bu:f1=0:goto640
  102. 720 goto640
  103. 730 data2,34,66,98,130,162,194,226
  104. 900 input#15,en$,em$,et$,es$:ifval(en$)<20thenreturn
  105. 910 mn$=""+en$+" "+em$+" "+et$+" "+es$
  106. 911 printrg$;spc(int(21-len(mn$)/2))mn$
  107. 920 printrg$" [159]press any key to continue or q to quit"
  108. 921 gete$:ife$=""then921
  109. 922 ife$<>"q"thenrun
  110. 930 close8:close15
  111. 999 end
  112.